{extend name="common@base" /}
{block name="content"}
<section class="content" id="container">
  <div class="box box-default">
    <div class="box-body">
      <form action="" method="get" name="search" class="form">
        <div class="form-group">
          <label for="">卡号或者真实姓名 <input type="text" name="search[username]" value="{$search[username]}" class="form-control"> </label>
          <button type="submit" class="btn btn-default btn-sm">查询</button>
          <a href="{:url('index')}" class="btn btn-default btn-sm">重置</a>
        </div>
      </form>
    </div>
  </div>
  <div class="box box-primary">
    <div class="box-header with-border">
      <div class="box-title pull-right"><a href="{:url('edit')}" class="btn btn-primary">新增</a>
      </div>
    </div>
    <div class="box-body table-responsive">
      <table id="myTable" class="table table-striped">
        <thead>
        <tr>
          <th width="5%">ID</th>
          <th width="15%">一卡通</th>
          <th width="35%">真实姓名</th>
          <th width="10%">状态</th>
          <th width="15%">操作</th>
        </tr>
        </thead>
        <tbody>
        {foreach $rows as $row}
        <tr>
          <td>{$row.id}</td>
          <td>{$row.username}</td>
          <td>{$row.realname}</td>
          <td>{$row.statusText}</td>
          <td>
            <a href="{:url('edit',['id'=>$row.id])}" class="btn btn-default btn-sm">编辑</a>
            <a href="{:url('resetpw',['id'=>$row.id])}" class="btn btn-default btn-sm js-confirm">重置密码</a>

          </td>
        </tr>
        {/foreach}
        </tbody>
      </table>
    </div>
    <div class="box-footer">
      {$rows->render()}
    </div>
  </div>

</section>
{/block}
{block name="page_script"}
<script>
  require(["layer_config", "ajaxForm"], function () {
    $(".js-check-all").on("click", function () {
      var me=$(this);
      var objs = $(".js-user-ids");
      objs.prop("checked", me.prop("checked"));
    });
  });

</script>
{/block}
</body>
</html>
